<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>MyPanel.java</title>
</head>
<body bgcolor="white">
<pre><tt><font color="#000000">01:</font> <i><font color="#9A1900">// GF-PolskieZnaki/MyPanel.java</font></i>
<font color="#000000">02:</font>  
<font color="#000000">03:</font> <b><font color="#000080">import</font></b> java<font color="#990000">.</font>awt<font color="#990000">.</font>Graphics<font color="#990000">;</font>
<font color="#000000">04:</font> <b><font color="#000080">import</font></b> java<font color="#990000">.</font>awt<font color="#990000">.</font>Graphics2D<font color="#990000">;</font>
<font color="#000000">05:</font> <b><font color="#000080">import</font></b> java<font color="#990000">.</font>awt<font color="#990000">.</font>RenderingHints<font color="#990000">;</font>
<font color="#000000">06:</font> <b><font color="#000080">import</font></b> javax<font color="#990000">.</font>swing<font color="#990000">.</font>JPanel<font color="#990000">;</font>
<font color="#000000">07:</font> 
<font color="#000000">08:</font> <i><font color="#9A1900">// To tylko po to zeby byl antyaliasing (w nowych wersjach</font></i>
<font color="#000000">09:</font> <i><font color="#9A1900">// Javy antyaliasing powinien byc domyslnie i bez tego...).</font></i>
<font color="#000000">10:</font> <i><font color="#9A1900">// Jesli to sie okaze niepotrzebne, to mozna wyrzucic i w</font></i>
<font color="#000000">11:</font> <i><font color="#9A1900">// programie tworzyc zwykle obiekty JPanel zamiast MyPanel</font></i>
<font color="#000000">12:</font> 
<font color="#000000">13:</font> <b><font color="#0000FF">class</font></b> <font color="#009900">MyPanel</font> <b><font color="#0000FF">extends</font></b> JPanel <font color="#FF0000">{</font>
<font color="#000000">14:</font>     @Override
<font color="#000000">15:</font>     <b><font color="#0000FF">public</font></b> <font color="#009900">void</font> <b><font color="#000000">paintComponent</font></b><font color="#990000">(</font>Graphics g<font color="#990000">)</font> <font color="#FF0000">{</font>
<font color="#000000">16:</font>         Graphics2D g2 <font color="#990000">=</font> <font color="#990000">(</font>Graphics2D<font color="#990000">)</font>g<font color="#990000">;</font>
<font color="#000000">17:</font>         g2<font color="#990000">.</font><b><font color="#000000">setRenderingHint</font></b><font color="#990000">(</font>
<font color="#000000">18:</font>             RenderingHints<font color="#990000">.</font>KEY_ANTIALIASING<font color="#990000">,</font>
<font color="#000000">19:</font>             RenderingHints<font color="#990000">.</font>VALUE_ANTIALIAS_ON<font color="#990000">);</font>
<font color="#000000">20:</font>         g2<font color="#990000">.</font><b><font color="#000000">setRenderingHint</font></b><font color="#990000">(</font>
<font color="#000000">21:</font>             RenderingHints<font color="#990000">.</font>KEY_TEXT_ANTIALIASING<font color="#990000">,</font>
<font color="#000000">22:</font>             RenderingHints<font color="#990000">.</font>VALUE_TEXT_ANTIALIAS_ON<font color="#990000">);</font>
<font color="#000000">23:</font>         <b><font color="#0000FF">super</font></b><font color="#990000">.</font><b><font color="#000000">paintComponent</font></b><font color="#990000">(</font>g2<font color="#990000">);</font>
<font color="#000000">24:</font>     <font color="#FF0000">}</font>
<font color="#000000">25:</font> <font color="#FF0000">}</font>
<font color="#000000">26:</font> </tt></pre>
</body>
</html>
